package com.qc.bus.controller;


import com.baomidou.mybatisplus.extension.api.ApiController;
import com.qc.bus.entity.BusSalesback;
import com.qc.bus.service.BusSalesbackService;
import com.qc.bus.vo.SalesbackVo;
import com.qc.sys.common.ResultObj;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (BusSalesbackback)表控制层
 *
 * @author AltmanQccc
 * @since 2020-09-11 10:25:21
 */
@RestController
@RequestMapping("salesback")
public class BusSalesbackController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private BusSalesbackService busSalesbackService;
    
    /**
     * 添加退货信息
     */
    @PostMapping("addSalesback")
    public ResultObj addSalesback(BusSalesback sales){
        try {
            this.busSalesbackService.saveSalesback(sales);
            return ResultObj.BACK_SUCCESS;
        }catch (Exception e)
        {
            e.printStackTrace();
            return ResultObj.BACK_ERROR;
        }
    }

    /**
     * 查询并展示数据
     * */
    @GetMapping("loadAllSalesback")
    public Object loadAllSalesback(SalesbackVo salesVo){
        return this.busSalesbackService.queryAllSalesback(salesVo);
    }
}